#ifndef GREYIMAGEWRAPPER_H
#define GREYIMAGEWRAPPER_H

#include "AmaranthusCommon.h"
#include "ImageWrapperBase.h"
#include "SlicerWidget.h"
#include "GuidedNativeImageIO.h"

#include "itkImageToVTKImageFilter.h"
#include "itkMinimumMaximumImageCalculator.h"
#include "itkShiftScaleImageFilter.h"
#include "itkCastImageFilter.h"
#include "itkSmartPointer.h"

#include "vtkImageData.h"

#include <QMessageBox>
#include <QString>

class ConvertNativeImageToGrey;

class GreyImageWrapper : public ImageWrapperBase
{

public:
    typedef itk::MinimumMaximumImageCalculator<GreyImageType> MinMaxCalcType;
    typedef itk::SmartPointer<MinMaxCalcType> MinMaxCalcPointer;

    typedef itk::ShiftScaleImageFilter<GreyImageType, GreyImageType> ShiftFilterType;
    typedef itk::SmartPointer<ShiftFilterType> ShiftFilterPointer;

    GreyImageWrapper();
    ~GreyImageWrapper() {}

    void SetImage(ImageBaseType* imageBase);

    GreyImageType* GetImage()
    { return m_GreyImage.GetPointer(); }

private:
    template<class TPixel>
    void CastImageToGrey(ImageBaseType* inputImage);

    MinMaxCalcPointer m_MinMaxCalc;
    ShiftFilterPointer m_ShiftFilter;

    GreyImagePointer m_GreyImage;
};

#endif
